<template>
  <view class="feedback">
    <view class="content">
      <textarea
        style="padding: 26rpx 0 0 24rpx; width: 100%; height: 100%"
        v-model="value1"
        :maxlength="200"
        placeholder="请输入反馈内容（200字）" />
    </view>
    <view
      class="btn"
      @click="handleSubmit"
      >确定</view
    >
  </view>
</template>

<script>
export default {
  data() {
    return {
      value1: ''
    }
  },
  methods: {
    async handleSubmit() {
      if (!this.value1) {
        this.$api.msg('请输入反馈内容')
        return false
      }
      const { code, result, message } = await this.$u.post(
        '/freight-business/feedback/add',
        {
          feedbackInfo: this.value1
        }
      )
      if (code == '0') {
        this.$api.msg('反馈成功')
        this.value1 = ''
        setTimeout(() => {
          uni.navigateBack()
        }, 1000)
      } else {
        this.$api.msg(message)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
page {
  background: #f6f6f6;
  height: 100vh;
  padding: 24rpx 30rpx 0;
  box-sizing: border-box;
}

.content {
  width: 100%;
  height: 774rpx;
  background: #ffffff;
  border-radius: 10rpx;
}

.btn {
  position: absolute;
  width: 690rpx;
  height: 80rpx;
  background: #378afb;
  border-radius: 10rpx;
  font-size: 32rpx;
  line-height: 80rpx;
  text-align: center;
  color: #fff;
  bottom: 48rpx;
  left: 0;
  right: 0;
  margin: 0 auto;
}
</style>
